#ifndef __GfxDriver_WGL_WGLRenderTarget_h__
#define __GfxDriver_WGL_WGLRenderTarget_h__

#include "GfxDriver/RenderTarget.h"

#include "GfxDriver/WGL/GLInclude.h"

namespace Orca {

	class GfxDriver;

	//--------------------------------------------------------------------------
	class WGLRenderTarget : public RenderTarget {

	public:
		enum {MAX_COLOR_TARGET = 4};

		static WGLRenderTarget* create(GfxDriver *gfxDriver);
		
		WGLRenderTarget();

		virtual ~WGLRenderTarget();

		virtual uint32 getMaxColorTarget();
		virtual bool makeCurrent();
		virtual bool bindColorTarget(uint32 channel, TextureRendered *target);
		virtual bool bindDepthTarget(DepthBuffer *target);

	private:
		GfxDriver			*mGfxDriver;
		GLuint				mGLHandle;
		bool				mDirty;
		bool				mHasColorTarget;

		TextureRendered	*mColorTarget[MAX_COLOR_TARGET];
		DepthBuffer		*mDepthTarget;

		bool _init(GfxDriver *gfxDriver);

	};
}

#endif	// __GfxDriver_WGL_WGLRenderTarget_h__